package com.kede.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 产品表
 * @TableName sy_unishop_product
 */
@TableName(value ="sy_unishop_product")
@Data
public class UnishopProductDomain implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Object id;

    /**
     * 分类ID
     */
    @TableField(value = "category_id")
    private Integer categoryId;

    /**
     * 产品标题
     */
    @TableField(value = "title")
    private String title;

    /**
     * 主图
     */
    @TableField(value = "image")
    private String image;

    /**
     * 组图
     */
    @TableField(value = "images")
    private String images;

    /**
     * 详情
     */
    @TableField(value = "`desc`")
    private String desc;

    /**
     * 市场价
     */
    @TableField(value = "market_price")
    private BigDecimal marketPrice;

    /**
     * 销售价
     */
    @TableField(value = "sales_price")
    private BigDecimal salesPrice;

    /**
     * 销售量
     */
    @TableField(value = "sales")
    private Integer sales;

    /**
     * 库存
     */
    @TableField(value = "stock")
    private Integer stock;

    /**
     * 浏览量
     */
    @TableField(value = "look")
    private Integer look;

    /**
     * 已下单但是未付款量
     */
    @TableField(value = "no_buy_yet")
    private Integer noBuyYet;

    /**
     * 是否使用规格
     */
    @TableField(value = "use_spec")
    private Integer useSpec;

    /**
     * 规格属性
     */
    @TableField(value = "specList")
    private String speclist;

    /**
     * 规格值
     */
    @TableField(value = "specTableList")
    private String spectablelist;

    /**
     * 权重
     */
    @TableField(value = "weigh")
    private Integer weigh;

    /**
     * 运费模板
     */
    @TableField(value = "delivery_id")
    private Integer deliveryId;

    /**
     * 真实销量
     */
    @TableField(value = "real_sales")
    private Integer realSales;

    /**
     * 真实浏览量
     */
    @TableField(value = "real_look")
    private Integer realLook;

    /**
     * 是否上架:0=否,1=是
     */
    @TableField(value = "`switch`")
    private Integer switchStatus;

    /**
     * 服务
     */
    @TableField(value = "`server`")
    private String server;

    /**
     * 更新时间
     */
    @TableField(value = "updatetime")
    private Integer updatetime;

    /**
     * 创建时间
     */
    @TableField(value = "createtime")
    private Integer createtime;

    /**
     * 删除时间
     */
    @TableField(value = "deletetime")
    private Integer deletetime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UnishopProductDomain other = (UnishopProductDomain) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCategoryId() == null ? other.getCategoryId() == null : this.getCategoryId().equals(other.getCategoryId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getImage() == null ? other.getImage() == null : this.getImage().equals(other.getImage()))
            && (this.getImages() == null ? other.getImages() == null : this.getImages().equals(other.getImages()))
            && (this.getDesc() == null ? other.getDesc() == null : this.getDesc().equals(other.getDesc()))
            && (this.getMarketPrice() == null ? other.getMarketPrice() == null : this.getMarketPrice().equals(other.getMarketPrice()))
            && (this.getSalesPrice() == null ? other.getSalesPrice() == null : this.getSalesPrice().equals(other.getSalesPrice()))
            && (this.getSales() == null ? other.getSales() == null : this.getSales().equals(other.getSales()))
            && (this.getStock() == null ? other.getStock() == null : this.getStock().equals(other.getStock()))
            && (this.getLook() == null ? other.getLook() == null : this.getLook().equals(other.getLook()))
            && (this.getNoBuyYet() == null ? other.getNoBuyYet() == null : this.getNoBuyYet().equals(other.getNoBuyYet()))
            && (this.getUseSpec() == null ? other.getUseSpec() == null : this.getUseSpec().equals(other.getUseSpec()))
            && (this.getSpeclist() == null ? other.getSpeclist() == null : this.getSpeclist().equals(other.getSpeclist()))
            && (this.getSpectablelist() == null ? other.getSpectablelist() == null : this.getSpectablelist().equals(other.getSpectablelist()))
            && (this.getWeigh() == null ? other.getWeigh() == null : this.getWeigh().equals(other.getWeigh()))
            && (this.getDeliveryId() == null ? other.getDeliveryId() == null : this.getDeliveryId().equals(other.getDeliveryId()))
            && (this.getRealSales() == null ? other.getRealSales() == null : this.getRealSales().equals(other.getRealSales()))
            && (this.getRealLook() == null ? other.getRealLook() == null : this.getRealLook().equals(other.getRealLook()))
            && (this.getSwitchStatus() == null ? other.getSwitchStatus() == null : this.getSwitchStatus().equals(other.getSwitchStatus()))
            && (this.getServer() == null ? other.getServer() == null : this.getServer().equals(other.getServer()))
            && (this.getUpdatetime() == null ? other.getUpdatetime() == null : this.getUpdatetime().equals(other.getUpdatetime()))
            && (this.getCreatetime() == null ? other.getCreatetime() == null : this.getCreatetime().equals(other.getCreatetime()))
            && (this.getDeletetime() == null ? other.getDeletetime() == null : this.getDeletetime().equals(other.getDeletetime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCategoryId() == null) ? 0 : getCategoryId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getImage() == null) ? 0 : getImage().hashCode());
        result = prime * result + ((getImages() == null) ? 0 : getImages().hashCode());
        result = prime * result + ((getDesc() == null) ? 0 : getDesc().hashCode());
        result = prime * result + ((getMarketPrice() == null) ? 0 : getMarketPrice().hashCode());
        result = prime * result + ((getSalesPrice() == null) ? 0 : getSalesPrice().hashCode());
        result = prime * result + ((getSales() == null) ? 0 : getSales().hashCode());
        result = prime * result + ((getStock() == null) ? 0 : getStock().hashCode());
        result = prime * result + ((getLook() == null) ? 0 : getLook().hashCode());
        result = prime * result + ((getNoBuyYet() == null) ? 0 : getNoBuyYet().hashCode());
        result = prime * result + ((getUseSpec() == null) ? 0 : getUseSpec().hashCode());
        result = prime * result + ((getSpeclist() == null) ? 0 : getSpeclist().hashCode());
        result = prime * result + ((getSpectablelist() == null) ? 0 : getSpectablelist().hashCode());
        result = prime * result + ((getWeigh() == null) ? 0 : getWeigh().hashCode());
        result = prime * result + ((getDeliveryId() == null) ? 0 : getDeliveryId().hashCode());
        result = prime * result + ((getRealSales() == null) ? 0 : getRealSales().hashCode());
        result = prime * result + ((getRealLook() == null) ? 0 : getRealLook().hashCode());
        result = prime * result + ((getSwitchStatus() == null) ? 0 : getSwitchStatus().hashCode());
        result = prime * result + ((getServer() == null) ? 0 : getServer().hashCode());
        result = prime * result + ((getUpdatetime() == null) ? 0 : getUpdatetime().hashCode());
        result = prime * result + ((getCreatetime() == null) ? 0 : getCreatetime().hashCode());
        result = prime * result + ((getDeletetime() == null) ? 0 : getDeletetime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", categoryId=").append(categoryId);
        sb.append(", title=").append(title);
        sb.append(", image=").append(image);
        sb.append(", images=").append(images);
        sb.append(", desc=").append(desc);
        sb.append(", marketPrice=").append(marketPrice);
        sb.append(", salesPrice=").append(salesPrice);
        sb.append(", sales=").append(sales);
        sb.append(", stock=").append(stock);
        sb.append(", look=").append(look);
        sb.append(", noBuyYet=").append(noBuyYet);
        sb.append(", useSpec=").append(useSpec);
        sb.append(", speclist=").append(speclist);
        sb.append(", spectablelist=").append(spectablelist);
        sb.append(", weigh=").append(weigh);
        sb.append(", deliveryId=").append(deliveryId);
        sb.append(", realSales=").append(realSales);
        sb.append(", realLook=").append(realLook);
        sb.append(", switch=").append(switchStatus);
        sb.append(", server=").append(server);
        sb.append(", updatetime=").append(updatetime);
        sb.append(", createtime=").append(createtime);
        sb.append(", deletetime=").append(deletetime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}